

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The console module &mdash; pyamp v1.2 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="pyamp v1.2 documentation" href="../index.html" />
    <link rel="up" title="The input module" href="mod_pyamp_ui_input.html" />
    <link rel="next" title="The evdev module" href="pyamp_ui_input_evdev.html" />
    <link rel="prev" title="The keys module" href="pyamp_ui_input_keys.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_evdev.html" title="The evdev module"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_keys.html" title="The keys module"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">pyamp v1.2 documentation</a> &raquo;</li>
          <li><a href="mod_pyamp.html" >The pyamp module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui.html" >The ui module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui_input.html" accesskey="U">The input module</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyamp.ui.input.console">
<span id="the-console-module"></span><h1>The console module<a class="headerlink" href="#module-pyamp.ui.input.console" title="Permalink to this headline">¶</a></h1>
<p>The console module provides the ability to retrieve input from the user
through the console.</p>
<div class="section" id="the-consoleinput-class">
<h2>The ConsoleInput class<a class="headerlink" href="#the-consoleinput-class" title="Permalink to this headline">¶</a></h2>
<p class="graphviz">
<img src="../_images/inheritance-98fe028ebabb854aa0cf9ba42ed0a9f34d2fb2cd.png" alt="Inheritance diagram of pyamp.ui.input.console.ConsoleInput" usemap="#inheritanceb83c05d5b4" class="inheritance"/>
<map id="inheritanceb83c05d5b4" name="inheritanceb83c05d5b4">
<area shape="rect" href="pyamp_logging_loggable.html#pyamp.logging.loggable.Loggable" title="pyamp.logging.loggable.Loggable" alt="" coords="5,84,240,111"/>
<area shape="rect" href="pyamp_processes_threading_thread.html#pyamp.processes.threading.thread.Thread" title="pyamp.processes.threading.thread.Thread" alt="" coords="79,161,372,188"/>
<area shape="rect" href="#pyamp.ui.input.console.ConsoleInput" title="pyamp.ui.input.console.ConsoleInput" alt="" coords="97,239,353,265"/>
</map>
</p>
<dl class="class">
<dt id="pyamp.ui.input.console.ConsoleInput">
<em class="property">class </em><tt class="descclassname">pyamp.ui.input.console.</tt><tt class="descname">ConsoleInput</tt><big>(</big><em>callback</em>, <em>conditionFn=&lt;function &lt;lambda&gt; at 0xa099d4c&gt;</em>, <em>exceptionFn=None</em>, <em>logger=None</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput" title="Permalink to this definition">¶</a></dt>
<dd><p>The ConsoleInput class provides the ability to receive input from
a user through the console. This class runs as a separate thread which
monitors the console for input and notifies a callback method in the event
that keyboard input is received.</p>
<p>The callback method must take one argument which is the character that was
read as input. This class also provides the ability to register a callback
function to be called in the event that an exception occurs during the
processing of the thread.</p>
<p>This class implements the <a class="reference internal" href="../processes.html#pyamp.processes.Thread" title="pyamp.processes.Thread"><tt class="xref py py-class docutils literal"><span class="pre">pyamp.processes.Thread</span></tt></a>, and the
<tt class="xref py py-class docutils literal"><span class="pre">amp.logging.Loggable</span></tt> interfaces.</p>
<ul>
<li><p class="first">callback &#8211; The function called when input is received</p>
</li>
<li><dl class="first docutils">
<dt>conditionFn &#8211; The function used to determine whether we should</dt>
<dd><p class="first last">continue waiting for input</p>
</dd>
</dl>
</li>
<li><p class="first">exceptionFn &#8211; The functionc called when an exception is encountered</p>
</li>
<li><p class="first">logger &#8211; The logger object</p>
</li>
</ul>
<dl class="classmethod">
<dt id="pyamp.ui.input.console.ConsoleInput.clearScreen">
<em class="property">classmethod </em><tt class="descname">clearScreen</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.clearScreen"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.clearScreen" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear the console screen.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.ui.input.console.ConsoleInput.getCols">
<em class="property">classmethod </em><tt class="descname">getCols</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.getCols"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.getCols" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the number of columns for this console screen.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.ui.input.console.ConsoleInput.getRows">
<em class="property">classmethod </em><tt class="descname">getRows</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.getRows"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.getRows" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the number of rows for this console screen.</p>
</dd></dl>

<dl class="classmethod">
<dt id="pyamp.ui.input.console.ConsoleInput.getSize">
<em class="property">classmethod </em><tt class="descname">getSize</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.getSize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.getSize" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the size of the current console screen.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.console.ConsoleInput.onCycle">
<tt class="descname">onCycle</tt><big>(</big><em>_increment</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.onCycle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.onCycle" title="Permalink to this definition">¶</a></dt>
<dd><p>Called during each cycle of the Thread.</p>
<ul class="simple">
<li>increment &#8211; The current increment number</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.console.ConsoleInput.onException">
<tt class="descname">onException</tt><big>(</big><em>e</em>, <em>traceback</em><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.onException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.onException" title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called in the event that an exception
occurs during the processing of the thread.</p>
<ul class="simple">
<li>e &#8211; The exception</li>
<li>traceback &#8211; The traceback</li>
</ul>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.console.ConsoleInput.onShutdown">
<tt class="descname">onShutdown</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.onShutdown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.onShutdown" title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the ConsoleInput Thread is shutdown.</p>
</dd></dl>

<dl class="method">
<dt id="pyamp.ui.input.console.ConsoleInput.onStart">
<tt class="descname">onStart</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/pyamp/ui/input/console.html#ConsoleInput.onStart"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyamp.ui.input.console.ConsoleInput.onStart" title="Permalink to this definition">¶</a></dt>
<dd><p>Called when the ConsoleInput thread is started.</p>
</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">The console module</a><ul>
<li><a class="reference internal" href="#the-consoleinput-class">The ConsoleInput class</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="pyamp_ui_input_keys.html"
                        title="previous chapter">The keys module</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="pyamp_ui_input_evdev.html"
                        title="next chapter">The evdev module</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/_generated/pyamp_ui_input_console.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_evdev.html" title="The evdev module"
             >next</a> |</li>
        <li class="right" >
          <a href="pyamp_ui_input_keys.html" title="The keys module"
             >previous</a> |</li>
        <li><a href="../index.html">pyamp v1.2 documentation</a> &raquo;</li>
          <li><a href="mod_pyamp.html" >The pyamp module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui.html" >The ui module</a> &raquo;</li>
          <li><a href="mod_pyamp_ui_input.html" >The input module</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, Brett Ponsler.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
    </div>
  </body>
</html>